/**
 * @(#)com.pattern.p_04_singleton.Singleton
 *
 * Copyright (c) 2014-2018 一抹风光
 *
 * DESC:
 *
 */
package com.pattern.p_04_singleton;

/**
 * 单例模式
 *
 * @author fusf
 * @version 1.0  2016/10/15
 */
public class Singleton {

    private static Singleton singleton = null;

    private Singleton() {

    }

    public static Singleton getSingleton() {
        if (singleton == null) {
            synchronized (Singleton.class) {
                singleton = new Singleton();
            }
        }
        return singleton;
    }
}
